<template>
    <div class="box">
      <div class="header">
        <span>个人中心</span>
        <div class="right">
          <router-link to="/info">
            <img src="/static/lyl/dht-14.png" alt="">
          </router-link>
          <router-link to="/shezhi">
            <img src="/static/lyl/shezhi.png" alt="">
          </router-link>
        </div>
      </div>
      <div class="title">
        <router-link to="/gerenxinxi">
          <div class="one">
            <img :src="src" alt="">
            <span>{{nis}}</span>
          </div>
        </router-link>
        <router-link to="/wozhhu">
          <div class="two">账户提现</div>
        </router-link>
      </div>
      <div class="dan">
        <span>我的订单</span>
        <router-link to="/alldingdan/0">
          <span>查看所有订单</span>
          <img src="/static/lyl/youjian.png" alt="">
        </router-link>
      </div>
      <ul class="ulone">
        <li v-for="item in data">
          <router-link :to="item.to">
            <img :src="item.src" alt="">
            <p>{{item.txt}}</p>
          </router-link>
        </li>
      </ul>
      <div @click="iShow()" class="dan">
        <span>我的返金排号</span>
        <router-link to="/paifan">
          <span>查看更多</span>
          <img src="/static/lyl/youjian.png" alt="">
        </router-link>
      </div>
      <ul v-if="boll" class="ultwo">
        <li v-for="item in data2">
          <span>{{item.date}}</span>
          <span>{{item.pices}}</span>
          <span>{{item.hao}}</span>
        </li>
      </ul>
      <ul class="ulthree">
        <li v-for="item in data3">
          <router-link :to="item.to">
            <p>{{item.num}}</p>
            <p>{{item.txt}}</p>
          </router-link>
        </li>
      </ul>
      <ul class="ulfour">
        <li v-for="item in data4">
          <router-link :to="item.to">
            <img :src="item.src" alt="">
            <p>{{item.txt}}</p>
          </router-link>
        </li>
      </ul>

      <Tabbar></Tabbar>
    </div>
</template>

<script>
  import Tabbar from '../com/Tabbar'
  import faker from 'faker'
    export default {
      name: "Mine",
      data(){
        return {
           src:faker.image.avatar(),
           boll:false,
           data:[
             {to:'/daizhifu/1',src:'/static/lyl/zhifu.png',txt:'待支付'},
             {to:'/daifahuo/2',src:'/static/lyl/fahuo.png',txt:'待发货'},
             {to:'/daishouhuo/3',src:'/static/lyl/shouhuo.png',txt:'待收货'},
             {to:'/jywc/4',src:'/static/lyl/ok.png',txt:'交易完成'}
           ],
           data2:[
             {date:'2017/06/26',pices:'消费：￥100',hao:'排号：10'},
             {date:'2017/06/26',pices:'消费：￥100',hao:'排号：10'},
             {date:'2017/06/26',pices:'消费：￥100',hao:'排号：10'},
             {date:'2017/06/26',pices:'消费：￥100',hao:'排号：10'}
           ],
           data3:[
             {to:'/myshenzhi',num:this.$store.state.shen,txt:'我的神灯值'},
             {to:'/mfooter',num:0,txt:'我的足迹'},
             {to:'/',num:0,txt:'我的优惠券'},
             {to:'/swxq',num:0,txt:'我的心得'},
           ],
          data4:[
            {to:'/shangcheng',src:'/static/lyl/shangcheng.png',txt:'我的商城'},
            {to:'/shenfenz',src:'/static/lyl/renzheng.png',txt:'实名认证'},
            {to:'/address',src:'/static/lyl/dizhi.png',txt:'收货地址'},
            {to:'/gongzh',src:'/static/lyl/gongzhong.png',txt:'关注公众号'},
            {to:'/',src:'/static/lyl/fankui.png',txt:'客服与反馈'}
          ]
        }
      },
      methods:{
        iShow(){
          this.boll = !this.boll;
        }
      },
      components:{
        Tabbar
      },
      computed:{
        nis(){
          return this.$store.state.nichen;
        }
      }
    }
</script>

<style scoped>
  .box{
    background: #f2f2f2;
    padding-bottom:12.5rem;
  }
  .header{
    position: relative;
    padding: 3rem 0;
    background: #e53e42;
    display: flex;
    justify-content: center;
  }
  .header span{
    font-size: 3.6rem;
    color: #fff;
  }
  .header .right{
    position: absolute;
    right: 0;
    bottom: 3rem;
  }
  .header .right img{
    width: 4rem;
    margin-right: 3rem;
  }
  .title{
    background: url("/static/lyl/beijing.png") no-repeat center/cover;
    padding: 4.5rem 4.5rem 3.8rem 2rem;
    display: flex;
    justify-content: space-between;
    height: 15.7rem;
  }
  .title .one{
    height: 10rem;
    display: flex;
  }
  .title .one img{
    width: 10rem;
    height: 10rem;
    border-radius: 50%;
  }
  .title .one span:nth-child(2){
    font-size: 3rem;
    line-height: 3.6rem;
    align-self: center;
    margin-left: 2rem;
    color: #fff;
  }
  .title .two{
    width: 14rem;
    height: 4rem;
    border-radius: 2rem;
    background: rgba(0,0,0,0.7);
    font-size: 2.4rem;
    line-height: 4rem;
    text-align: center;
    color: #fff;
  }
  .title a:nth-child(2){
    align-self: flex-end;
  }
  .dan{
    padding: 2.5rem 2rem;
    background: #fff;
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
  }
  .dan span{
    font-size: 3rem;
    line-height: 3.6rem;
  }
  .dan a span{
    font-size: 2.4rem;
    line-height: 3.6rem;
    margin-right: 0.5rem;
  }
  .dan a img{
    width: 1rem;
    height: 2rem;
  }
  .ulone{
    background: #fff;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
  }
  .ulone li{
    padding: 2rem 0;
    margin: 0 5rem;
    text-align: center;
  }
  .ulone li img{
    width: 3.2rem;
    height: 2.9rem;
  }
  .ulone li p{
    font-size: 2.4rem;
    line-height: 3.6rem;
    margin-top: 1rem;
  }
  .ultwo{
    background: #fff;
  }
  .ultwo li{
    display: flex;
    justify-content: space-between;
    padding: 2.7rem 0;
    border-bottom: 1px solid #ccc;
  }
  .ultwo li span{
    font-size: 2.8rem;
    line-height: 3.6rem;
    margin: 0 4rem;
  }
  .ulthree{
    border-bottom: 1px solid #ccc;
    text-align: center;
    padding: 3rem 0;
    background: #fff;
    display: flex;
    justify-content: space-between;
  }
  .ulthree li{
    width: 25%;
  }
  .ulthree li a p:nth-child(1){
    font-size: 3rem;
    line-height: 3.6rem;
    color: #e53e42;
  }
  .ulthree li a p:nth-child(2){
    font-size: 2.4rem;
    line-height: 3.6rem;
  }

  .ulfour{
    padding: 3rem 0 3rem 0;
    background: #fff;
    text-align: center;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .ulfour li{
    width: 25%;
  }
  .ulfour li:nth-child(4n+4){
    margin-right: 0;
  }
  .ulfour li:nth-child(5){
    margin-top: 2rem;
  }
  .ulfour li img{
    width: 4rem;
  }
  .ulfour li p{
    font-size: 2.4rem;
    line-height: 3.6rem;
    margin-top: 1rem;
  }
</style>
